<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/top::head">
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div th:replace="/common/top::header">

</div>
<div id="Content">
<div id="BackLink">
    <a href="../catalog/MainController">Return to Main Menu</a>
</div>

<div id="Catalog">

    <div id="Cart">

        <h2>My Orders</h2>
        <form  method="post" action="CartController">
            <table>
                <tr>
                    <th><b>Order ID</b></th>
                    <th><b>Item ID</b></th>
                    <th><b>Item Introduction</b></th>
                    <th><b>Address</b></th>
                    <th><b>Order Phone</b></th>
                    <th><b>Delivery Name</b></th>
                    <th><b>Item Price</b></th>
                    <th><b>Item Number</b></th>
                    <th><b>Total Price</b></th>
                    <th><b>Payment Method</b></th>
                    <th><b>Order Timestamp</b></th>
                </tr>
                <!-- 判断 -->

                    <tr th:if="${orders.size()} eq '0'">
                        <td colspan="8"><b>Your orders is empty.</b></td>
                    </tr>


                    <tr th:each="order:${orders}">
                        <td ><a th:href="|/order/OrderDetailController?order_id=${order.orderId}|" th:text="${order.orderId}"></a></td>
                        <td ><a th:href="|/catalog/ItemController?item_id=${order.itemId}|" th:text="${order.itemId}"></a></td>
                        <td th:text="${order.itemIntroduction}"></td>
                        <td th:text="${order.address}"></td>
                        <td th:text="${order.orderPhone}"></td>
                        <td th:text="${order.deliveryName}"></td>
                        <td th:text="${order.itemPrice}"></td>
                        <td th:text="${order.itemNumber}"></td>
                        <td th:text="${order.totalPrice}"></td>
                        <td th:text="${order.paymentMethod}"></td>
                        <td th:text="${order.orderTimestamp}"></td>
                    </tr>

               <!-- <c:if test="${orders.size()==0}">
                    <tr>
                        <td colspan="8"><b>Your orders is empty.</b></td>
                    </tr>
                </c:if>
                &lt;!&ndash; 循环 &ndash;&gt;
                <c:forEach items="${orders}" var="order">
                    <tr>
                        <td><a href="../order/OrderDetailController?order_id=${order.orderId}">${order.orderId}</a></td>
                        <td><a href="../catalog/ItemController?item_id=${order.itemId}">${order.itemId}</a></td>
                        <td>${order.itemIntroduction}</td>
                        <td>${order.address}</td>
                        <td>${order.orderPhone}</td>
                        <td>${order.deliveryName}</td>
                        <td>${order.itemPrice}</td>
                        <td>${order.itemNumber}</td>
                        <td>${order.totalPrice}</td>
                        <td>${order.paymentMethod}</td>
                        <td>${order.orderTimestamp}</td>
                    </tr>
                </c:forEach>-->
            </table>
        </form>
    </div>

    <div id="MyList">
        <!-- 判断 -->
        <include file="IncludeMyList.html" />
    </div>

    <div id="Separator">&nbsp;</div>
</div>
</div>
<div th:replace="common/bottom">

</div>
</body>
</html>